import styles from './styles.less';
import SearchForm from './components/SearchForm';
import DataTable from './components/DataTable';
import {useState} from 'react';
import DataForm from './components/DataForm';
import Cates from './components/cates/App';
import Specs from './components/specs/App';

const App = () => {

  const [tablePayload, setTablePayload] = useState({pageNum: 1, pageSize: 15, param: {}});
  const [dataForm, setDataForm] = useState(undefined);
  const [cates, setCates] = useState(undefined);
  const [specs, setSpecs] = useState(undefined);

  return (
    <div className={styles.myContainer}>
      <DataForm data={{dataForm, setDataForm, tablePayload, setTablePayload}}/>
      <SearchForm data={{tablePayload, setTablePayload}}/>
      <DataTable data={{setSpecs, setCates, setDataForm, tablePayload, setTablePayload}}/>
      <Cates data={{cates, setCates}}/>
      <Specs data={{specs, setSpecs, goodsTablePayload: tablePayload, setGoodsTablePayload: setTablePayload}}/>
    </div>
  );
};

export default App;
